﻿using System;

using mvcForum.Core;
using mvcForum.Core.Abstractions;
using mvcForum.Core.Interfaces.Data;

namespace mvcForum.SearchProvider.Lucene {

	public class LuceneConfiguration : AsyncAddOnConfiguration<Indexer> {

		public LuceneConfiguration(IRepository<AddOnConfiguration> configRepo) : base(configRepo) { }

		private static class Keys {
			public const String Enabled = "Enabled";
			public const String TitleWeight = "TitleWeight";
			public const String TopicWeight = "TopicWeight";
			public const String StickyWeight = "StickyWeight";
			public const String AnnouncementWeight = "AnnouncementWeight";
		}

		public Int32 TitleWeight {
			get {
				return this.GetInt32(Keys.TitleWeight);
			}
			set {
				this.Set(Keys.TitleWeight, value);
			}
		}

		public Int32 TopicWeight {
			get {
				return this.GetInt32(Keys.TopicWeight);
			}
			set {
				this.Set(Keys.TopicWeight, value);
			}
		}

		public Int32 StickyWeight {
			get {
				return this.GetInt32(Keys.StickyWeight);
			}
			set {
				this.Set(Keys.StickyWeight, value);
			}
		}

		public Int32 AnnouncementWeight {
			get {
				return this.GetInt32(Keys.AnnouncementWeight);
			}
			set {
				this.Set(Keys.AnnouncementWeight, value);
			}
		}

		public Boolean Enabled {
			get {
				return this.GetBoolean(Keys.Enabled);
			}
			set {
				this.Set(Keys.Enabled, value);
			}
		}
	}
}